import { remote } from 'electron'
import { BASE_URL } from '../config'
const newProjectWinURL = `${BASE_URL}/#newProject`
let newProjectWin: Electron.BrowserWindow
const createNewProjectWindow = (): Electron.BrowserWindow => {
  if (!newProjectWin) {
    const obj = {
      parent: remote.getCurrentWindow(),
      modal: true,
      webPreferences: {
        nodeIntegration: true
      }
    }
    newProjectWin = new remote.BrowserWindow(obj)
    newProjectWin.loadURL(newProjectWinURL)
  }
  return newProjectWin
}
export default createNewProjectWindow
